package advice;

import org.aspectj.lang.ProceedingJoinPoint;

public class MyAroundAdvice {
    public Object aroundMethod(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("【前置处理】方法："+pjp.getSignature().getName());
        try {
            //执行目标方法
            Object result= pjp.proceed();

            System.out.println("【后置处理】返回值："+result);
            return result;
        } catch (Throwable e) {
            System.out.println("【异常处理】异常"+e.getMessage());
            throw e;
        }finally {
            System.out.println("【最终处理】方法执行结束");
        }
    }
}
